import { makeAutoObservable } from 'mobx';
import { injectable } from 'inversify';
import { ROOM_MODE } from './enum.ts';

@injectable()
export class RoomModel {
  private _loading = false;
  private _mode: ROOM_MODE = ROOM_MODE.CODE;
  private _note_view = false;

  get loading() {
    return this._loading;
  }

  set loading(loading: boolean) {
    this._loading = loading;
  }

  get mode(): ROOM_MODE {
    return this._mode;
  }

  set mode(mode: ROOM_MODE) {
    this._mode = mode;
  }

  get noteView() {
    return this._note_view;
  }

  constructor() {
    makeAutoObservable(this);
  }

  setNoteView() {
    this._note_view = !this._note_view;
  }

  dispose() {
    this.loading = false;
  }
}
